const http = require('http')
const server = http.createServer()

server.on('request', (request, response) => {
    response.setHeader('Content-Type', 'text/plain;charset=utf-8')
    response.end('欢迎使用Node.js创建Web服务')
})

server.listen(3000, () => {
    console.log('Web服务已启动')
})